﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;
using QLTV.DAL;
using QLTV.Public;

namespace QLTV.DAL
{
    public class CTPhieuDAL
    {
        ConnectionData connect;
        public int nhapCTP(PhieuSachDTO p,CTPhieuDTO c)
        {
            try
            {
                connect = new ConnectionData();
                int Nparamater = 2;
                string[] name = new string[Nparamater];
                object[] value = new object[Nparamater];
                name[0] = "@MaDG";
                value[0] = p.MaDG;
                name[1] = "@MaSach";
                value[1] = c.MaSach;
                return connect.UpdateData("CTPhieu_Insert", name, value, Nparamater);
            }
            catch (Exception)
            {
                throw;
            }
        }
    }
}
